<!-- 
  @author: 善良的YWJ
  @Created by shanliangdeYWJ on 2021/07/23 01:06:04
  @file: Box.vue
  @description:
  ```
  请输入文件描述内容
  ```
  @link [Github](https://github.com/shanliangdeYWJ)
-->

<template>
  <div class="box">{{ type }}</div>
</template>

<script setup>
const props = defineProps(["type"])

const typeToColorMap = {
  [0]: "gray",
  [1]: "red",
}

const color = typeToColorMap[props.type]
</script>

<style scoped>
.box {
  width: 25px;
  height: 25px;
  margin: 2px;
  background: v-bind(color);
}
</style>
